home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / change2g / frmmain.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-05-04  |  9.2 KB  |  277 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Ascii Finder"
  5.    ClientHeight    =   3780
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   6855
  9.    Icon            =   "frmMain.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   3780
  14.    ScaleWidth      =   6855
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.TextBox Text1 
  17.       BackColor       =   &H00FFFFFF&
  18.       ForeColor       =   &H00000000&
  19.       Height          =   2850
  20.       Left            =   0
  21.       Locked          =   -1  'True
  22.       MultiLine       =   -1  'True
  23.       ScrollBars      =   2  'Vertical
  24.       TabIndex        =   3
  25.       Top             =   360
  26.       Width           =   6855
  27.    End
  28.    Begin VB.ComboBox Combo1 
  29.       Height          =   315
  30.       ItemData        =   "frmMain.frx":0742
  31.       Left            =   0
  32.       List            =   "frmMain.frx":0744
  33.       Sorted          =   -1  'True
  34.       Style           =   2  'Dropdown List
  35.       TabIndex        =   2
  36.       TabStop         =   0   'False
  37.       Top             =   0
  38.       Width           =   3645
  39.    End
  40.    Begin VB.CommandButton cmdQuit 
  41.       Caption         =   "&Quit"
  42.       Height          =   465
  43.       Left            =   6345
  44.       TabIndex        =   0
  45.       TabStop         =   0   'False
  46.       Top             =   -45
  47.       Width           =   555
  48.    End
  49.    Begin VB.CommandButton cmdSize 
  50.       Caption         =   "Font S&ize"
  51.       Height          =   465
  52.       Left            =   5535
  53.       TabIndex        =   1
  54.       TabStop         =   0   'False
  55.       Top             =   -45
  56.       Width           =   825
  57.    End
  58.    Begin VB.CommandButton cmdSearch 
  59.       Caption         =   "Ascii S&earch"
  60.       Height          =   465
  61.       Left            =   4500
  62.       TabIndex        =   10
  63.       TabStop         =   0   'False
  64.       Top             =   -45
  65.       Width           =   1050
  66.    End
  67.    Begin VB.Label Label6 
  68.       AutoSize        =   -1  'True
  69.       BackStyle       =   0  'Transparent
  70.       Caption         =   "About"
  71.       ForeColor       =   &H00FF0000&
  72.       Height          =   195
  73.       Left            =   6300
  74.       TabIndex        =   9
  75.       ToolTipText     =   "About"
  76.       Top             =   3600
  77.       Width           =   420
  78.    End
  79.    Begin VB.Label Label5 
  80.       AutoSize        =   -1  'True
  81.       Caption         =   "COPY:"
  82.       BeginProperty Font 
  83.          Name            =   "MS Sans Serif"
  84.          Size            =   8.25
  85.          Charset         =   0
  86.          Weight          =   700
  87.          Underline       =   0   'False
  88.          Italic          =   0   'False
  89.          Strikethrough   =   0   'False
  90.       EndProperty
  91.       Height          =   195
  92.       Left            =   4680
  93.       TabIndex        =   8
  94.       Top             =   3375
  95.       Width           =   570
  96.    End
  97.    Begin VB.Label Label4 
  98.       AutoSize        =   -1  'True
  99.       Caption         =   "C&haracter"
  100.       Height          =   195
  101.       Left            =   5265
  102.       TabIndex        =   7
  103.       ToolTipText     =   "Click to Copy the Alphanumeric Character to the Clipboard"
  104.       Top             =   3510
  105.       Width           =   690
  106.    End
  107.    Begin VB.Label Label3 
  108.       AutoSize        =   -1  'True
  109.       Caption         =   "Ascii C&ode"
  110.       ForeColor       =   &H00000000&
  111.       Height          =   195
  112.       Left            =   5265
  113.       TabIndex        =   6
  114.       ToolTipText     =   "Click to Copy the ASCII Code to the Clipboard"
  115.       Top             =   3285
  116.       Width           =   750
  117.    End
  118.    Begin VB.Label Label2 
  119.       Alignment       =   2  'Center
  120.       BorderStyle     =   1  'Fixed Single
  121.       BeginProperty Font 
  122.          Name            =   "MS Sans Serif"
  123.          Size            =   18
  124.          Charset         =   0
  125.          Weight          =   400
  126.          Underline       =   0   'False
  127.          Italic          =   0   'False
  128.          Strikethrough   =   0   'False
  129.       EndProperty
  130.       ForeColor       =   &H00000000&
  131.       Height          =   510
  132.       Left            =   6075
  133.       TabIndex        =   5
  134.       Top             =   3240
  135.       Width           =   780
  136.    End
  137.    Begin VB.Label Label1 
  138.       Caption         =   "INFOTEXT"
  139.       Height          =   510
  140.       Left            =   45
  141.       TabIndex        =   4
  142.       Top             =   3240
  143.       Width           =   4620
  144.    End
  145. Attribute VB_Name = "Form1"
  146. Attribute VB_GlobalNameSpace = False
  147. Attribute VB_Creatable = False
  148. Attribute VB_PredeclaredId = True
  149. Attribute VB_Exposed = False
  150. Option Explicit
  151. Private Sub cmdSearch_Click()
  152.     On Error GoTo bailOut
  153.     Dim asciiChar As Integer
  154.     asciiChar = InputBox("Enter Ascii code:", "Ascii Search")
  155.     If asciiChar < 0 Or asciiChar > 255 Then
  156.         MsgBox "Ascii character must be between 0 and 255", vbExclamation, "Error"
  157.         Exit Sub
  158.     End If
  159.     Text1.SelLength = 0
  160.     Text1.SelStart = (asciiChar * 2) - 1
  161.     Text1.SelLength = 1
  162.     Label1.Caption = "ASCII Code: " & Asc(Text1.SelText)
  163.     Label1.Caption = Label1.Caption & vbCrLf & "Alphanumeric Representation: " & Text1.SelText
  164.     Label2.Caption = Text1.SelText
  165.     Text1.SetFocus
  166. bailOut:
  167.     Text1.SetFocus
  168. End Sub
  169. Private Sub Form_Activate()
  170.     Form1.Enabled = False
  171.     Dim a As Variant
  172.     For a = 0 To Screen.FontCount - 1
  173.         Form1.Caption = "Ascii Finder: Loading System Fonts " & a * 100 \ Screen.FontCount & "%"
  174.         DoEvents
  175.         Combo1.AddItem Screen.Fonts(a)
  176.     Next a
  177.     Form1.Caption = "Ascii Finder"
  178.     Text1.Text = Chr(0)
  179.     For a = 1 To 255
  180.         Text1.Text = Text1.Text & " " & Chr(a)
  181.     Next a
  182.     Text1.SelStart = 1
  183.     Text1.SelLength = 1
  184.     Label1.Caption = "ASCII Code: " & Asc(Text1.SelText)
  185.     Label1.Caption = Label1.Caption & vbCrLf & "Alphanumeric Representation: " & Text1.SelText
  186.     Label2.Caption = Text1.SelText
  187.     Form1.Enabled = True
  188.     Text1.SetFocus
  189. End Sub
  190. Private Sub Form_Load()
  191.     Label2.FontSize = 20
  192.     Label1.Caption = ""
  193. End Sub
  194. Private Sub Label6_Click()
  195.     MsgBox "Ascii Finder" & vbCrLf & "Version: " & App.Major & "." & App.Minor & "." & App.Revision & vbCrLf & _
  196.     Chr(169) & "1999 Blitz Entertainment" & vbCrLf & vbCrLf & "If you find this app usefull or not, tell me why" & vbCrLf & _
  197.     "and what you would like to see in future versions " & vbCrLf & _
  198.     "and I'll let you know when a new version is out." & vbCrLf & vbCrLf _
  199.     & "Send me a buzz at:" & vbCrLf & "Jian_man@geocities.com", vbInformation, "About Ascii Finder"
  200.     Text1.SetFocus
  201. End Sub
  202. Private Sub cmdQuit_Click()
  203.     Unload Me
  204.     End
  205. End Sub
  206. Private Sub Combo1_Click()
  207.     Text1.FontName = Combo1.List(Combo1.ListIndex)
  208.     Label2.FontName = Combo1.List(Combo1.ListIndex)
  209.     Text1.SetFocus
  210. End Sub
  211. Private Sub cmdSize_Click()
  212.     Dim size As String
  213.     size = InputBox("Enter Font Size:", "Font Size", Text1.FontSize)
  214.     If size <> "" Then Text1.FontSize = size
  215.     Text1.SetFocus
  216. End Sub
  217. Private Sub Label3_Click()
  218.     On Error GoTo bailOut
  219.     Clipboard.Clear
  220.     Clipboard.SetText Asc(Text1.SelText)
  221. bailOut:
  222. End Sub
  223. Private Sub Label3_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  224.     Label3.ForeColor = &HFF&
  225. End Sub
  226. Private Sub Label3_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  227.     Label3.ForeColor = &H0&
  228. End Sub
  229. Private Sub Label4_Click()
  230.     On Error GoTo bailOut
  231.     Clipboard.Clear
  232.     Clipboard.SetText Text1.SelText
  233. bailOut:
  234. End Sub
  235. Private Sub Label4_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  236.     Label4.ForeColor = &HFF&
  237. End Sub
  238. Private Sub Label4_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  239.     Label4.ForeColor = &H0&
  240. End Sub
  241. Private Sub Text1_Click()
  242.     On Error GoTo bailOut
  243.     Text1.SelLength = 1
  244.     If Text1.SelText <> " " Then
  245.         Label1.Caption = "ASCII Code: " & Asc(Text1.SelText)
  246.         Label1.Caption = Label1.Caption & vbCrLf & "Alphanumeric Representation: " & Text1.SelText
  247.         Label2.Caption = Text1.SelText
  248.     Else
  249.         Text1.SelLength = 0
  250.         Text1.SelStart = Text1.SelStart - 1
  251.         Text1.SelLength = 1
  252.         Label1.Caption = "ASCII Code: " & Asc(Text1.SelText)
  253.         Label1.Caption = Label1.Caption & vbCrLf & "Alphanumeric Representation: " & Text1.SelText
  254.         Label2.Caption = Text1.SelText
  255.     End If
  256.     Text1.SetFocus
  257. bailOut:
  258. End Sub
  259. Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
  260.     On Error GoTo bailOut
  261.     Text1.SelLength = 1
  262.     If Text1.SelText <> " " Then
  263.         Label1.Caption = "ASCII Code: " & Asc(Text1.SelText)
  264.         Label1.Caption = Label1.Caption & vbCrLf & "Alphanumeric Representation: " & Text1.SelText
  265.         Label2.Caption = Text1.SelText
  266.     Else
  267.         Text1.SelLength = 0
  268.         Text1.SelStart = Text1.SelStart - 1
  269.         Text1.SelLength = 1
  270.         Label1.Caption = "ASCII Code: " & Asc(Text1.SelText)
  271.         Label1.Caption = Label1.Caption & vbCrLf & "Alphanumeric Representation: " & Text1.SelText
  272.         Label2.Caption = Text1.SelText
  273.     End If
  274.     Text1.SetFocus
  275. bailOut:
  276. End Sub
  277.